package concreteCommand;

import command.Command;
import lombok.AllArgsConstructor;
import model.Order;
import receiver.SeniorChef;

import java.util.Map;

@AllArgsConstructor
public class OrderCommand implements Command {

    //持有接收者对象
    private SeniorChef seniorChef;

    //持有订单对象
    private Order order;

    @Override
    public void execute() {
        System.out.println(order.getDiningTable() + "桌的订单:");
        for (Map.Entry<String, Integer> entry : order.getFoodDir().entrySet()) {
            seniorChef.makeFood(entry.getKey(), entry.getValue());
        }
        System.out.println(order.getDiningTable() + "桌的饭准备完成");
    }

}
